﻿' ///////////////////////////////////////////////////////////////
' // This is generated code. 
' //////////////////////////////////////////////////////////////
' // Code is generated using LLBLGen Pro version: 2.6
' // Code is generated on: lundi 28 septembre 2009 23:24:55
' // Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
' // Templates vendor: Solutions Design.
' // Templates version: 
' //////////////////////////////////////////////////////////////
Imports System
Imports Aricie.DNN.Services.Url.FriendlyUrl
Imports Aricie.DNN.Services.Url.FriendlyUrl.HelperClasses
Imports SD.LLBLGen.Pro.ORMSupportClasses

Namespace Aricie.DNN.Services.Url.FriendlyUrl.FactoryClasses
	''' <summary>
	''' Generates IEntityFields2 instances for different kind of Entities. 
	''' This class is generated. Do not modify.
	''' </summary>
	Public Class EntityFieldsFactory
		''' <summary>Private CTor, no instantiation possible.</summary>
		Private Sub New()
		End Sub

	
		''' <summary>General factory entrance method which will return an EntityFields object with the format generated by the factory specified</summary>
		''' <param name="relatedEntityType">The type of entity the fields are for</param>
		''' <returns>The IEntityFields2 instance requested</returns>
		Public Shared Function CreateEntityFieldsObject(relatedEntityType As Aricie.DNN.Services.Url.FriendlyUrl.EntityType) As IEntityFields2
			Dim fieldsToReturn As IEntityFields2 = Nothing
			Dim inheritanceProvider As IInheritanceInfoProvider = InheritanceInfoProviderSingleton.GetInstance()
			Dim fieldProvider As IFieldInfoProvider = FieldInfoProviderSingleton.GetInstance()
			Select Case relatedEntityType
				Case Aricie.DNN.Services.Url.FriendlyUrl.EntityType.FupPatternMappingEntity
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "FupPatternMappingEntity")
				Case Aricie.DNN.Services.Url.FriendlyUrl.EntityType.FupUrlMappingEntity
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, "FupUrlMappingEntity")
			End Select
			Return fieldsToReturn
		End Function
		
		''' <summary>General method which will Return an array of IEntityFieldCore objects, used by the InheritanceInfoProvider. Only the fields defined In the entity are returned, no inherited fields.</summary>
		''' <param name="entityName">the name of the entity To Get the fields For. Example: "CustomerEntity"</param>
		''' <returns>array of IEntityFieldCore fields, defined In the entity With the name specified</returns>
		Friend Shared Function CreateFields(entityName As String) As IEntityFieldCore()
			Dim toReturn As IEntityFieldCore() = Nothing
			Dim fieldProvider As IFieldInfoProvider = FieldInfoProviderSingleton.GetInstance()
			Return fieldProvider.GetEntityFieldsArray(entityName)
		End Function
	

	


#Region "Included Code"

#End Region
	End Class
End Namespace